package com.monicash.monicash.base;

import android.os.Bundle;
import android.text.Html;
import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;

public abstract class BaseFragment extends Fragment {

    public abstract void initView();
    public abstract void initData();

    public void isShowView(String value, View view, TextView textView, String text) {
        view.setTag(value);
        if (TextUtils.equals(value, "1")) {
            view.setVisibility(View.VISIBLE);
            String tip_value = "<font color='#C84958'>* </font>"+text;
            textView.setText(Html.fromHtml(tip_value));
        } else if (TextUtils.equals(value, "2")) {
            view.setVisibility(View.VISIBLE);
            textView.setText(text ); //+ " (opcional)"
        } else {
            view.setVisibility(View.GONE);
        }
    }
}
